<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:trans="http://www.quickzip.org/Translation"
    xmlns:local="clr-namespace:QuickZip.UserControls.Themes"
    xmlns:uc="http://www.quickzip.org/UserControls"
    >
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/QuickZip.UserControls;component/Themes/Styles/AeroListView.xaml" />        
        <ResourceDictionary Source="pack://application:,,,/QuickZip.UserControls;component/Themes/Brushes.xaml" />
        <ResourceDictionary Source="pack://application:,,,/QuickZip.UserControls;component/Themes/Geometry.xaml" />
    </ResourceDictionary.MergedDictionaries>


    <Style x:Key="qz_GridFileListItem_Style" TargetType="{x:Type ListViewItem}" 
           BasedOn="{StaticResource AeroGridViewItemContainerStyleKey}">        
        <Setter Property="TextSearch.Text" Value="{Binding EmbeddedModel.Label, Mode=OneWay}" />
        <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
    </Style>

    <Style x:Key="qz_FileListItem_Style" TargetType="{x:Type ListViewItem}" 
           >
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="TextSearch.Text" Value="{Binding EmbeddedModel.Label, Mode=OneWay}" />
        <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBoxItem">
                    <Border Name="Border" Padding="2" SnapsToDevicePixels="true"                             
                            BorderThickness="1"
                            BorderBrush="Transparent"
                            Background="Transparent">
                        <ContentPresenter 
                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="uc:SelectionHelper.IsDragging" Value="true">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource HotTrackBrush}"/>
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource HotTrackBrush}"/>
                        </Trigger>
                        <Trigger Property="IsSelected" Value="true">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource SelectedBackgroundBrush}"/>
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource LightBorderBrush}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" 
                                        Value="{StaticResource DisabledForegroundBrush}"/>
                        </Trigger>
                        <EventTrigger RoutedEvent="FrameworkElement.Loaded">
                            <BeginStoryboard>
                                <Storyboard Storyboard.Target="{Binding}">
                                    <DoubleAnimation Storyboard.TargetProperty="Opacity" From="0.5" To="1" Duration="0:0:1" />
                                </Storyboard>
                            </BeginStoryboard>
                        </EventTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    

    <ControlTemplate x:Key="ListViewTemplate" TargetType="ListView">
        <Border Name="Border" BorderThickness="1" BorderBrush="{StaticResource SolidBorderBrush}" 
                Background="{StaticResource WindowBackgroundBrush}">
            <ScrollViewer Style="{DynamicResource {x:Static GridView.GridViewScrollViewerStyleKey}}">
                <ItemsPresenter />
            </ScrollViewer>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="IsGrouping" Value="true">
                <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
                <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBorderBrush}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <DataTemplate x:Key="NormHeaderTemplate">
        <Grid HorizontalAlignment="Stretch" Margin="6,0">
            <TextBlock Text="{Binding}" TextAlignment="Left" Margin="0,2,0,0" />
        </Grid>
    </DataTemplate>
    <DataTemplate x:Key="DescHeaderTemplate">
        <Grid HorizontalAlignment="Stretch" Margin="6,0">
            <TextBlock Text="{Binding}" TextAlignment="Left" Margin="0,2,0,0" />
            <Path Data="{StaticResource descArrow}" Fill="{StaticResource GlyphBrush}" HorizontalAlignment="Center"  />
        </Grid>
    </DataTemplate>
    <DataTemplate x:Key="AscHeaderTemplate">
        <Grid HorizontalAlignment="Stretch" Margin="6,0">
            <TextBlock Text="{Binding}" TextAlignment="Left" Margin="0,2,0,0" />
            <Path Data="{StaticResource ascArrow}" Fill="{StaticResource GlyphBrush}"  HorizontalAlignment="Center" />
        </Grid>
    </DataTemplate>

    <Style x:Key="ColumnHeaderContainerStyle" TargetType="GridViewColumnHeader">
        <Setter Property="BorderBrush" Value="Transparent" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
    </Style>

</ResourceDictionary>
